package com.rp.system.dao;

import org.raptor.common.DbOperUtil;
import org.raptor.orm.hibernate.DbaHibernateTemplateSupport;
import org.raptor.pagination.Page2;
import org.springframework.stereotype.Repository;

import com.rp.common.vo.PageParam;
import com.rp.system.po.SysLog;

@Repository
public class SysLogDao extends DbaHibernateTemplateSupport<SysLog> {

	/**
	 * 分页获取操作日志数据
	 * @param pageParam
	 * @return
	 */
	public Page2 getSysLogByPage(PageParam pageParam, String description, String operResult, String methodName, String createDate){
		String hql = "from SysLog where description like ? and operResult like? and methodName like ? and createDate like ?";
		return getPage2ByOffset(hql, 
				pageParam.getPageOffset(), pageParam.getPageSize(), 
				pageParam.getSortField(), pageParam.getSortOrder(),
				DbOperUtil.fuzzyQueryParam(description),
				DbOperUtil.fuzzyQueryParam(operResult),
				DbOperUtil.fuzzyQueryParam(methodName),
				DbOperUtil.fuzzyQueryParam(createDate));
	}
	
}
